package com.ruoyi.rulengine.service.impl;

import com.ruoyi.rulengine.domain.RuleCondition;
import com.ruoyi.rulengine.mapper.RuleConditionMapper;
import com.ruoyi.rulengine.service.IRuleConditionService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 规则条件Service业务层处理
 *
 * @author changkang
 * @date 2025-05-12
 */
@Service
public class RuleConditionServiceImpl implements IRuleConditionService {
    @Resource
    private RuleConditionMapper ruleConditionMapper;

    /**
     * 查询规则条件
     *
     * @param id 规则条件主键
     * @return 规则条件
     */
    @Override
    public RuleCondition selectRuleConditionById(Long id)
    {
        return ruleConditionMapper.selectRuleConditionById(id);
    }

    /**
     * 查询规则条件列表
     *
     * @param ruleCondition 规则条件
     * @return 规则条件
     */
    @Override
    public List<RuleCondition> selectRuleConditionList(RuleCondition ruleCondition) {
        return ruleConditionMapper.selectRuleConditionList(ruleCondition);
    }

    /**
     * 新增规则条件
     *
     * @param ruleCondition 规则条件
     * @return 结果
     */
    @Override
    public int insertRuleCondition(RuleCondition ruleCondition)
    {
        return ruleConditionMapper.insertRuleCondition(ruleCondition);
    }

    /**
     * 修改规则条件
     *
     * @param ruleCondition 规则条件
     * @return 结果
     */
    @Override
    public int updateRuleCondition(RuleCondition ruleCondition)
    {
        return ruleConditionMapper.updateRuleCondition(ruleCondition);
    }

    /**
     * 批量删除规则条件
     *
     * @param ids 需要删除的规则条件主键
     * @return 结果
     */
    @Override
    public int deleteRuleConditionByIds(Long[] ids)
    {
        return ruleConditionMapper.deleteRuleConditionByIds(ids);
    }

    /**
     * 删除规则条件信息
     *
     * @param id 规则条件主键
     * @return 结果
     */
    @Override
    public int deleteRuleConditionById(Long id)
    {
        return ruleConditionMapper.deleteRuleConditionById(id);
    }
}
